<#include "/common/head2.html"/> 
<div class="easyui-panel addPage" data-options="fit:true,border:false,novalidate:true">
	<form class="easyui-form" id="ff" method="post" data-options="novalidate:true">
		<table>
			<tr>
				<td>
					<span class="search_item">
						        <span class="adertisement">规则类型： </span>
						        <!--<span class="item_obj">
						           	<input class="easyui-combobox" name="type" id="type" style="width:100px" data-options="
						           			valueField: 'id',
						    				textField: 'text',
						    				panelHeight:'auto',
						    				editable:false,
						           			data: [
						           				{id:'type', text:'运营商','selected':true}
							            		,{id:'type1', text:'信用卡'}
							            		,{id:'type2', text:'储蓄卡'}
							            		,{id:'type3', text:'京东'}
							            		,{id:'type4', text:'淘宝'}
							            		,{id:'type5', text:'征信'}
						           			]
						           	" />
						           	</span> -->
						           <span class="item_obj">
										<!--  	通过字典添加 -->
					                    <select class="easyui-combobox" name="db_source" panelHeight="auto" style="width:100px" data-options="
					                    	url: '${basePath}/common/getDictData?queryParams[dict_type]=db_source',
					                    	valueField:'dict_key',
					                		textField:'dict_value'
					                		">
					                	</select>
					               </span>
					 </span>
				</td>
			</tr>
			
			<tr>
				<td>
					<span class="adertisement">规则名称：</span>
					<input style="width: 100px;height: 20px;" required="true" class="easyui-validatebox" type="text" id="name" name="name" value=""></input>
				</td>
			</tr>
			
			<tr>
				<td>
					<span class="search_item">
						<span class="adertisement">类型： </span>
						<span class="search_item">
				        	<select class="easyui-combobox" name="rule_type" id="rule_type" style="width:100px">
					        	<option value ="6"></option>
	                          	<option value ="0">规则区间</option>
	                            <option value ="1">规则条件</option>
                             </select>
			                 	<div style="display: inline-block;margin-left: 20px;" id="rule_section">
			                                                              最小值：<input style="width: 50px;height: 15px;"required="true" class="easyui-validatebox" type="text" id="minValue" name="minValue" value=""></input>
			                                                              最大值： <input style="width: 50px;height: 15px;" required="true" class="easyui-validatebox" type="text" id="mxValue" name="mxValue" value=""></input>
			                    </div>
                        <span id="rule_section2" style="display:none;">
                			<select class="easyui-combobox" name="rule_section2" id="rule_section2" style="width:100px">
                             	<option value ="是" id="condition1">是</option>
                                <option value ="否" id="condition2">否</option>
                         	</select>
                        </span>
                    	</span>
                    </span> 
				</td>			
			</tr>
			
			<tr>
				<td>
					<span class="adertisement">分值：</span>
					<input style="width: 50px;height: 20px;" required="true" class="easyui-validatebox" type="text" id="store" name="store" value=""></input>
				</td>
			</tr>
			
			<tr>
				<td>
					<span class="adertisement">规则描述：</span>
					<input style="width: 290px;height: 20px;" required="true" class="easyui-validatebox" type="text" id="description" name="description" value=""></input>
				</td>
			</tr>
			
			<tr>
				<td>
					<span class="search_item">
						<span class="adertisement">数据通道： </span>
						<span class="search_item">
				        	<select class="easyui-combobox" name="data_channel" id="data_channel" style="width:100px">
					        	<option value ="6">请选择通道</option>
	                          	<option value ="0">数美</option>
	                            <option value ="1">同顿</option>
                            </select>
                            <span class="adertisement" style="margin-left: 30px;">接口： </span>
	                        <span id="data_section" style="display:none;margin-left: -25px;">
	                			<select class="easyui-combobox" name="data_section" id="data_section" style="width:100px">
	                             	<option value ="6">请选择接口</option>
	                             	<option value ="学历" id="condition1">学历</option>
	                             	<option value ="黑名单" id="condition1">黑名单</option>
	                                <option value ="多头借贷" id="condition2">多头借贷</option>
	                         	</select>
	                        </span>
	                        <span id="data_section2" style="display:none;margin-left: -25px;">
	                			<select class="easyui-combobox" name="data_section2" id="data_section2" style="width:100px">
	                             	<option value ="6">请选择接口</option>
	                             	<option value ="黑名单" id="condition1">黑名单</option>
	                                <option value ="多头借贷" id="condition2">多头借贷</option>
	                         	</select>
	                        </span>
                    	</span>
                    </span> 
				</td>			
			</tr>
			
			<tr>
            	<td>
            	<div data-options="region:'south',border:false" style="text-align: right; padding: 12px; border-top-width: 0px; border-top-style: solid; border-top-color: rgb(221, 221, 221); width: 674px; height: 28px;" title="" class="panel-body panel-body-noheader panel-body-noborder layout-body">
            		<a class="easyui-linkbutton color1 l-btn l-btn-small" href="javascript:void(0)" onclick="javascript:save();" style="width: 220px;">
            			<span class="l-btn-center" style="margin-top: 0px;"><span class="l-btn-text">确定</span></span>
            		</a>
        		</div>
            	</td>
            </tr>				
		</table>
	</form>
</div>
<script type="text/javascript">
//提交保存
function save() {
	$("#ff").form('submit', { 
        url: "addPage", 
        /* onSubmit: function () {   
        	//表单提交前的回调函数 
        	if(!$("#ff").form('enableValidation').form('validate')) {
            	$.messager.alert('操作结果','请检查标红输入项','error');
        		return false;
        	}       	
        	data_channel
        },  */
        success: function (v) {
        	location.replace('list')
    	}
      }); 
}

/* 类型选择 */
$("#rule_section").hide();
$("#rule_section2").hide();
$(function() {
	// 选择规则区间和条件
	$("#rule_type").combobox({
		onChange:function(){
			var type=$("#rule_type").combobox("getValue");
			if (type=='0') {
				$("#rule_section").show();
				$("#rule_section2").hide();
			}
			if(type=='1'){
				$("#rule_section2").show();
				$("#rule_section").hide();
			}
		}
	});
	
});
/* 通道选择 */
$("#data_section").hide();
$("#data_section2").hide();
$(function() {
	// 选择规则区间和条件
	$("#data_channel").combobox({
		onChange:function(){
			var type=$("#data_channel").combobox("getValue");
			if (type=='0') {
				$("#data_section").show();
				$("#data_section2").hide();
			}
			if(type=='1'){
				$("#data_section2").show();
				$("#data_section").hide();
			}
		}
	});
	
});

</script>
<#include "/common/dialogWindow.html"/>
<#include "/common/foot.html"/>